
//
//  UIBarButtonItem+RBExtension.m
//  Budejie
//
//  Created by 华杨科技 on 2017/9/19.
//  Copyright © 2017年 饶波. All rights reserved.
//

#import "UIBarButtonItem+RBExtension.h"

@implementation UIBarButtonItem (RBExtension)
+ (UIBarButtonItem *)itemWithImage:(NSString *)image highlightImage:(NSString *)highImage target:(id)target action:(SEL)action{
    // 按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [button sizeToFit];
    return [[UIBarButtonItem alloc] initWithCustomView:button];
}
@end
